/*
@auther fenglei
*/
package xxlog

import (
	"fmt"
	"github.com/getsentry/sentry-go"
	"go.uber.org/zap"
	"time"
)

func ErrorUp366(err error) {
	if is_print || XXLog_Logger == nil {
		fmt.Println("error:", err)
	}
	if XXLog_Logger != nil {
		XXLog_Logger.Error("error", zap.Error(err))
	}
	sentry.CaptureException(err)
	defer sentry.Flush(time.Second * 2)
}
func ErrorUp366Msg(msg string, err error) {
	if is_print {
		fmt.Println("error:", msg, err)
	}
	XXLog_Logger.Error(msg, zap.Error(err))
	sentry.ConfigureScope(func(scope *sentry.Scope) {
		scope.SetContext("msg", sentry.Context{"message": msg})
	})
	sentry.CaptureException(err)
	defer sentry.Flush(time.Second * 2)
}
func InfoUp366(v ...interface{}) {
	if is_print || XXLog_Logger == nil {
		fmt.Println("info:", fmt.Sprint(v...))
	}
	if XXLog_Logger != nil {
		XXLog_Logger.Info(fmt.Sprint(v...))
	}
}
func InfoUp366F(format string, v ...interface{}) {
	XXLog_Logger.Sugar().Infof(format, v...)
}
